Communication apparatus and method for controlling communication apparatus

ABSTRACT

There is provided a communication apparatus. A communication unit transmits data to a communication module, which communicates with an external device, according to a clock signal, and receives data from the communication module in accordance with a timing corresponding to a timing signal generated by delaying the clock signal. An adjustment unit adjusts an amount of the delay. A control unit controls the communication unit to repeatedly perform first processing for transmitting a first command to the communication module, second processing for receiving a first response that is sent from the communication module, and third processing for transmitting a packet to the communication module according to the first response. In a predetermined mode, the control unit controls the communication unit to perform processing for transmitting data of the packet regardless of contents of the first response.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to a communication apparatus and a methodfor controlling the communication apparatus.

Description of the Related Art

Conventionally, in the case where data is read out from a memory cardsuch as an SD memory card, the delay amount of data transmission fromthe card relative to a clock provided to the card from a host was astandardized fixed value. Accordingly, the host side was able to accessthe card without issue, by latching data at a timing delayed by thestandardized amount relative to the clock transmission.

However, increased clock speeds following improvements in the accessspeed of memory cards in recent years has meant that it is no longerpossible for the aforementioned delay amount to be prescribed with afixed value. Thus, UHS-I (Ultra High Speed-1), which is a high-speedstandard for SD memory cards, defines the need to adjust the data latchtiming in the case of using a clock that is faster than a predeterminedvalue. The operation of adjusting the latch timing is called tuning, andis generally performed when a memory card is mounted. Such tuningprocessing is described in Japanese Patent Laid-Open No. 2010-157058.

Also, in recent years, communication apparatuses that communicate withan external device using a wireless communication module that supportsSDIO standards have appeared. Such communication apparatuses are able tostream HD quality moving image data using the wireless communicationmodule that supports SDIO standards. Since the HD quality moving imagedata has a large data amount, the communication apparatus may need totransfer data in accordance with the UHS-I standard.

Even if the data latch timing, that is, the delay amount of the clock,is adjusted through tuning, this delay amount varies due to externalfactors such as subsequent changes in temperature. Thus, if tuning isonly performed when a card is mounted or before the start of streaming,there is a possibility that the delay amount could change following achange in temperature during streaming and lead to data receptionfailure. On the other hand, since data cannot be transmitted or receivedduring tuning, performing tuning during streaming could possibly resultin a reduction in the transfer rate and loss of data.

SUMMARY OF THE INVENTION

The present invention has been made in view of such situations, andprovides a technology for suppressing a reduction in the data transferrate during streaming.

According to a first aspect of the present invention, there is provideda communication apparatus comprising: an output unit configured tooutput a clock signal to a communication module that communicates withan external device; a generation unit configured to generate a timingsignal by delaying the clock signal; a communication unit configured totransmit data to the communication module according to the clock signal,and to receive data from the communication module in accordance with atiming corresponding to the timing signal; an adjustment unit configuredto adjust an amount of the delay; and a control unit configured tocontrol the communication unit to repeatedly perform first processingfor transmitting a first command to the communication module, secondprocessing for receiving a first response that is sent from thecommunication module in response to the first command, and thirdprocessing for transmitting a packet to the communication moduleaccording to the first response, wherein, in a predetermined mode inwhich the packet is continuously transmitted to the communication moduleby the communication unit repeatedly performing the first processing,the second processing and the third processing, the control unitcontrols the communication unit to perform processing for transmittingdata of the packet regardless of contents of the first response sentfrom the communication module in response to the first command andreceived by the communication unit.

According to a second aspect of the present invention, there is provideda communication apparatus comprising: an output unit configured tooutput a clock signal to a communication module that communicates withan external device; a generation unit configured to generate a timingsignal by delaying the clock signal; a communication unit configured totransmit data to the communication module according to the clock signal,and to receive data from the communication module in accordance with atiming corresponding to the timing signal; an adjustment unit configuredto adjust an amount of the delay; and a control unit configured tocontrol the communication unit to receive first data related to a dataamount of a packet to be transmitted from the communication module,according to an interrupt from the communication module that is receivedby the communication unit, and to control a frequency of the clocksignal based on the data amount of the packet that is detected based onthe first data.

According to a third aspect of the present invention, there is provideda method for controlling a communication apparatus having: an outputunit configured to output a clock signal to a communication module thatcommunicates with an external device; a generation unit configured togenerate a timing signal by delaying the clock signal; and acommunication unit configured to transmit data to the communicationmodule according to the clock signal, and to receive data from thecommunication module in accordance with a timing corresponding to thetiming signal, the method comprising: an adjustment step of adjusting anamount of the delay; and a control step of controlling the communicationunit to repeatedly perform first processing for transmitting a firstcommand to the communication module, second processing for receiving afirst response that is sent from the communication module in response tothe first command, and third processing for transmitting a packet to thecommunication module according to the first response, wherein, in apredetermined mode in which the packet is continuously transmitted tothe communication module by the communication unit repeatedly performingthe first processing, the second processing and the third processing,the control step comprises controlling the communication unit to performprocessing for transmitting data of the packet regardless of contents ofthe first response sent from the communication module in response to thefirst command and received by the communication unit.

According to a fourth aspect of the present invention, there is provideda method for controlling a communication apparatus having: an outputunit configured to output a clock signal to a communication module thatcommunicates with an external device; a generation unit configured togenerate a timing signal by delaying the clock signal; and acommunication unit configured to transmit data to the communicationmodule according to the clock signal, and to receive data from thecommunication module in accordance with a timing corresponding to thetiming signal, the method comprising: an adjustment step of adjusting anamount of the delay; and a control step of controlling the communicationunit to receive first data related to a data amount of a packet to betransmitted from the communication module, according to an interruptfrom the communication module that is received by the communicationunit, and to control a frequency of the clock signal based on the dataamount of the packet that is detected based on the first data.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a configuration of a communicationapparatus 100 according to a first embodiment.

FIG. 2A is a diagram showing a software configuration of thecommunication apparatus 100.

FIG. 2B is a block diagram showing a detailed configuration of a host IF114.

FIG. 3 is a sequence diagram illustrating streaming transfer controlaccording to the first embodiment.

FIG. 4 is a sequence diagram illustrating streaming transfer controlaccording to a second embodiment.

FIG. 5 is a flowchart of controls executed by the communicationapparatus 100 that correspond to the sequence diagram of FIG. 4.

FIG. 6 is a sequence diagram illustrating streaming transfer controlaccording to a third embodiment.

FIG. 7 is a flowchart of controls executed by the communicationapparatus 100 that correspond to the sequence diagram of FIG. 6.

DESCRIPTION OF THE EMBODIMENTS

Embodiments of the present invention will now be described withreference to the attached drawings. It should be noted that thetechnical scope of the present invention is defined by the claims, andis not limited by any of the embodiments described below. In addition,not all combinations of the features described in the embodiments arenecessarily required for realizing the present invention.

First Embodiment

FIG. 1 is a block diagram showing the configuration of a communicationapparatus 100 according to a first embodiment. In the communicationapparatus 100, an input unit 101 inputs moving image data and audio datafrom outside of the apparatus. The input unit 101 may include an imagesensor, in which case the communication apparatus 100 also functions asan image capturing apparatus. The input unit 101 may further include amicrophone. A signal processing unit 102 performs well-known encodingsuch as MPEG encoding on the input moving image data to compress theamount of information. A memory 103 stores various types of informationsuch as input moving image data, encoded moving image data andmanagement information.

A system control unit 104 has a microcomputer, and controls theoperations of the communication apparatus 100 by executing a computerprogram recorded in a nonvolatile memory 108. Also, the system controlunit 104 has a file system for managing files that are recorded on an SDmemory card 113. An operation unit 105 is provided with various types ofswitches such as a power switch and a switch for instructing movingimage recording start and stop. The user instructs the communicationapparatus 100 to perform operations by operating the operation unit 105.The nonvolatile memory 108 stores a computer program for operating thesystem control unit 104. A RAM 109 stores various types of data requiredin the processing by the system control unit 104.

A memory interface (IF) 112 communicates with the SD memory card 113 viaa connector which is not shown, and transmits various types of commandsand data to the SD memory card 113. Also, the memory IF 112 receivesinformation from the SD memory card 113, and sends the receivedinformation to the system control unit 104. A host interface (IF) 114 isconnected to a WLAN module 120 (communication module) via a connectorwhich is not shown. In the present embodiment, the host IF 114communicates with the WLAN module 120 in accordance with SDIO standards,and transmits various types of commands and data to a slave interface(IF) 121 in the WLAN module 120. Also, the host IF 114 receivesinformation from the WLAN module 120, and sends the received informationto the system control unit 104. A bus 110 transmits and receives databetween the various units.

A tuning unit 106 determines the optimal data latch timing by a methodthat will be discussed later. A SDCLK control unit 107 controls a clockthat is used for communication between the host IF 114 and the WLANmodule 120. A response processing unit 111 processes responses from theWLAN module 120.

In the present embodiment, the SD memory card 113 and the WLAN module120 are configured to be freely attachable/detachable to/from thecommunication apparatus 100 by the user with an apparatus or an ejectionmechanism that is not shown. However, the SD memory card 113 and theWLAN module 120 may be incorporated in the communication apparatus 100.Also, the user can easily carry the communication apparatus 100, theWLAN module 120, and the SD memory card 113. The WLAN module 120 isprovided with a CPU, a memory, a wireless LAN unit and the like, inaddition to the slave IF 121. The WLAN module 120 performs wirelesscommunication with an external device in accordance with a well-knownwireless communication system. The WLAN module 120 then communicateswith the external device in accordance with commands from thecommunication apparatus 100, and performs processing for transmittingdata to the external device and processing for receiving data from theexternal device. In the present embodiment, processing by the slave IF121 and processing for performing wireless communication with theexternal device are controlled by the CPU of the WLAN module 120.

The communication apparatus 100 has a function of recording stream datasuch as moving image data and audio data input from the input unit 101to the SD memory card 113. Also, the communication apparatus 100 has afunction of transmitting input stream data to an external device via theWLAN module 120 connected to the host IF 114. Furthermore, thecommunication apparatus 100 has a function of transmitting stream dataread out from the SD memory card 113 to an external device via the WLANmodule 120 connected to the host IF 114. Also, the communicationapparatus 100 has a function of receiving stream data transmitted froman external device via the WLAN module 120 connected to the host IF 114.Also, in the present embodiment, the host IF 114 and the WLAN module 120are able to communicate in accordance with UHS-I (Ultra High Speed-1),which is a high-speed standard for SD memory cards.

Next, the software configuration of the communication apparatus 100 willbe described with reference to FIG. 2A. An application 201 is a modulethat manages moving image data stored in the memory 103 of thecommunication apparatus 100. The application 201 executes write and readrequests in units of packets to the communication driver 202 withrespect to predetermined amounts of moving image data in the memory 103.Also, the application 201 controls a tuning driver 204, and controlswhether tuning is implemented or not implemented. Furthermore, theapplication 201 controls an SD clock control driver 205, and controlsthe frequency of the clock that is used by the host IF 114.

A communication driver 202 is a module for managing data that isgenerated by the communication apparatus 100, and executes write andread requests to an SD device driver 203 according to write and readrequests from the application 201. The SD device driver 203 is a driverthat controls the host IF 114, and transmits commands required fortuning which will be discussed later and data write, read and otherrequests to the WLAN module 120. The tuning driver 204 controls the SDdevice driver 203 to transmit a test pattern output command to the slaveIF 121 of the WLAN module 120. The SD device driver 203 receives a testpattern signal that is output from the slave IF 121 while changing thedata latch timing and determines the optimal data latch timing. Controlsfrom test pattern output command transmission to optimal data latchtiming determination are referred to as tuning.

Next, tuning will be described in further detail, with reference to FIG.2B. FIG. 2B is a block diagram showing a detailed configuration of thehost IF 114. The host IF 114 performs transmission and reception ofsignals and data via a CLK line, a CMD line and a DAT line intransmission and reception of data with respect to the WLAN module 120.Specifically, a clock source 251 outputs a clock signal (CLK signal)that is utilized for timing control of transmission and reception and isconstituted by clock pulses via the CLK line. The clock source 251changes the frequency of the clock signal that is output, according toan instruction from the SDCLK control unit 107. A host controller 252outputs a command signal relating to transmission and receives aresponse signal from the WLAN module 120 in response to the command viathe CMD line. Also, the host controller 252 performs transmission andreception control of data that is transmitted to the WLAN module 120 ordata that is received from the WLAN module 120 via the DAT line.

In transmission and reception of data, the timing of transmission andreception of data differs from the clock pulse, as mentioned above. Adelay element 253 thus delays the phase of the clock signal under thecontrol of the tuning unit 106 to the timing at which data is receivedfrom the WLAN module 120, for example, and generates a timing signal forlatching the data output from the WLAN module 120. A flip-flop 254 thenlatches the data output from the WLAN module 120, in accordance with thetiming signal output from the delay element 253. That is, the timingsignal prescribes the timing for latching data. Also, a flip-flop 256latches the data from the host controller 252, in accordance with thetiming from the clock source 251. Note that input and output of commandsand switching between the CMD line and the DAT line according to datatransmission and reception is performed by a signal branching unit 255.

In the case of tuning, the host IF 114 issues a test data transmissioncommand to the WLAN module 120. In response, the WLAN module 120transmits a 64-byte data sequence (test data) of a predetermined patternin synchronization with the clock signal that is sent from the clocksource 251. The host IF 114 receives the test data at the latch timingthat is determined by the clock signal generated by the clock source251. Here, the phase difference (time difference) between the clocksignal and the latch timing can be changed by changing the value of thenumber of delay stages that are set in the delay element 253. The tuningunit 106 determines whether or not the test data was successfullyreceived while changing the phase difference between the clock signaland the latch timing, that is, while changing latch timing. The tuningunit 106 then tunes the latch timing (i.e., adjusts the amount by whichthe timing signal is delayed) by selecting the most stable latch timingat which the test data was successfully received. Also, transmission andreception of data with respect to the WLAN module 120 cannot beperformed while tuning is being performed.

Tuning is processing that adjusts the timing related to reception ofdata, and thus does not directly affect transmission of data. That is,in the case of transmitting data from the host IF 114 to the WLAN module120, the clock signal and the transmission data need only besynchronized to satisfy a predetermined AC timing. This is sufficient toensure that the WLAN module 120 (specifically, the slave IF 121) willreceive data without failure that is transmitted from the host IF 114even if there is a temperature change. Problems arise in the case of thehost IF 114 receiving data from the WLAN module 120. The phasedifference between the clock signal that is output to the WLAN module120 and the timing signal for data reception changes due to a change intemperature. Thus, the phase difference between the timing signal fordata reception and the timing of data transmission by the WLAN module120 varies greatly. As a result, the host IF 114 could possibly fail toreceive the data, resulting in an error.

Next, control of streaming transfer to the WLAN module 120 by thecommunication apparatus 100 will be described. First, the features ofstreaming transfer will be described. Generally, with streamingtransfer, packet transfer in real time is required, so as to avoid lossof data at the receiving end. Therefore, in the case where a packet islost in transfer, the communication apparatus 100 performs control so asto minimize image loss at the receiving end, by transferring the nextpacket rather than resending the lost packet. Also, streaming transfermainly involves packet transmission, and does not often involve packetreception.

Streaming transfer control in the present embodiment will now bedescribed, in view of the above features related to streaming transfercontrol. FIG. 3 is a sequence diagram illustrating streaming transfercontrol according to the first embodiment. In FIG. 3, processing that isexecuted by the host IF 114 is realized by the system control unit 104controlling the various units of the communication apparatus 100. Theprocessing of FIG. 3 starts when the user operates the operation unit105 to instruct transmission of stream data input from the input unit101 or stream data played from the SD memory card 113, for example. Notethat the stream data that is transmitted in the present embodimentincludes moving image data or audio data.

Note that, in the following description, a CMD 52 and a CMD 53 are usedas commands that are transmitted and received between the host IF 114and the slave IF 121. The CMD 52 is used for communication that uses theCMD line and does not use the DAT line, and the CMD 53 is used forcommunication that uses the DAT line. Also, commands include a writecommand (W) for transmission (writing) of data, and a read command (R)for reception (reading) of data. For example, in the case where a CMD52(R) is transmitted from the host IF 114 to the slave IF 121 via theCMD line, the slave IF 121 transmits response data such as a status tothe host IF 114 via the CMD line. Also, the host IF 114 transmits theactual data for transmission to the slave IF 121 via the DAT line, aftertransmitting a CMD 53(W).

Initially, at step S3001, the system control unit 104 controls the hostIF 114 to issue the write command CMD 53(W) (first command) to the slaveIF 121. At step S3002, the host IF 114 receives a response (firstresponse) from the slave IF 121.

At step S3003, the system control unit 104 controls the responseprocessing unit 111 to determine that the command was successfullytransmitted regardless of the contents of the response, and advances theprocessing to step S3004. In the present embodiment, the communicationapparatus 100 does not perform tuning during streaming, and thus thehost IF 114 could possibly be unable to receive a response of thecorrect value. Also, even if a response of the correct value isinitially received, the fact that this sequence of processing isexecuted repeatedly during streaming, as will be discussed later, meansthat a response of the correct value could possibly not be received atsome point due to a temperature change. However, the system control unit104 of the present embodiment is constituted so as to determine that thecommand was successfully transmitted regardless of the contents of theresponse in a state where streaming processing is being executed, and isthus able to continue streaming normally.

Note that although not shown, the system control unit 104 determinesthat the slave IF 121 is not operating normally and stops transmissionof data if a response itself is not received. That is, the systemcontrol unit 104 determines with the response processing unit 111whether a response was received within a predetermined period after theCMD 53(W) was transmitted to the slave IF 121. The system control unit104 advances the processing to step S3004 regardless of the contents ifa response was received within the predetermined period, and ends thissequence of processing if a response was not received.

At step S3004, the system control unit 104 controls the host IF 114 tostart packet transmission. At step S3005, the host IF 114 transmits apredetermined amount of data to the slave IF 121 in units of packets. Atstep S3006, the host IF 114 completes packet transmission. Since packetsneed to be transmitted continuously in streaming transmission, afterstep S3006, the system control unit 104 returns the processing to stepS3001 and repeats the abovementioned controls.

According to the present embodiment, as described above, thecommunication apparatus 100 transmits packets to the WLAN module 120regardless of the contents of the response to the write command forpacket transmission. Tuning thereby no longer needs to be executedduring streaming, enabling tuning-related overheads to be reduced. Thus,a reduction in the data transfer rate during streaming can besuppressed, and image loss at the receiving end of the streaming can bereduced.

Note that although description was given using the CMD 53 in the presentembodiment, the type of command is not limited and other commands may beused.

Second Embodiment

In the first embodiment, description was given assuming that theprocessing returns from steps S3006 to S3001 in FIG. 3. However, when apredetermined amount of data is transmitted from the host IF 114 to theslave IF 121, an SDIO interrupt may occur from the slave IF 121 to thehost IF 114, depending on the implementation. The second embodimentdescribes the processing in such a case. Note that, in the presentembodiment, the basic configuration of the communication apparatus 100is similar to the first embodiment (see FIGS. 1, 2A and 2B).Hereinafter, the differences from the first embodiment will mainly bedescribed.

FIG. 4 is a sequence diagram illustrating streaming transfer controlaccording to the second embodiment. In FIG. 4, processing that isexecuted by the host IF 114 is realized by the system control unit 104controlling the various units of the communication apparatus 100.

The processing of steps S4001 to S4006 is similar to steps S3001 toS3006 of FIG. 3. After packet transmission from the host IF 114 to theslave IF 121 is completed in step S4006, the slave IF 121, at stepS4007, notifies the host IF 114 by SDIO interrupt. The SDIO interrupt isimplemented using part of the DAT line shown in FIG. 2B.

At step S4008, the system control unit 104 controls the host IF 114 toissue a CMD 52(R) (second command). At step S4009, the system controlunit 104 receives a response (second response). At step S4010, thesystem control unit 104 controls the response processing unit 111 todetermine whether there is an error in the contents of the response. Ifthere is an error in the contents of the response, the processingadvances to step S4011, and if this is not the case, the processingadvances to step S4012.

At step S4011, the system control unit 104 controls the SDCLK controlunit 107 to lower the clock frequency to a frequency at which packetscan be received. For example, the clock frequency is set to a lowerfrequency than the maximum frequency prescribed by UHS-I. The SDCKLcontrol unit 107 controls the clock source 251 of FIG. 2B to change thefrequency of the clock signal to the set frequency. With UHS-I, theclock frequency is determined by the transfer mode, with the clockfrequency in the fastest transfer mode being 208 MHz. In view of this,the system control unit 104 here sets the clock frequency to 50 MHz,which is lower than the maximum frequency.

At step S4012, the system control unit 104 controls the host IF 114 toissue a CMD 53(R) (third command), in order to receive data indicatingthe status of the WLAN module 120. At step S4013, the system controlunit 104 controls the host IF 114 to receive a response (thirdresponse). At step S4014, the slave IF 121 starts transmission of apacket that includes data indicating the status of the WLAN module 120.At step S4015, the slave IF 121 transmits the packet to the host IF 114.Since the clock frequency was lowered at step S4011 in the case wherethere is an error in the contents of the response of step S4009, thehost IF 114 is able to receive the packet normally in step S4015. Also,in the case where there is not an error in the contents of the responseof step S4009, the host IF 114 is able to receive the packet normally instep S4015, even though the clock frequency remains high. At step S4016,the host IF 114 completes packet reception. At step S4017, the systemcontrol unit 104 controls the SDCLK control unit 107 to raise the clockfrequency, in the case where the clock frequency was lowered in stepS4011. The SDCLK control unit 107 controls the clock source 251 tochange the frequency of the clock signal to a designated frequency.Typically, the system control unit 104 sets the clock frequency to thefrequency prior to being lowered in step S4011, but any frequency thatis higher than the frequency subsequent to being lowered in step S4011may be set. Thereafter, the processing returns to step S4001, similarlyto the first embodiment.

FIG. 5 is a flowchart of controls executed by the communicationapparatus 100 that correspond to the sequence diagram of FIG. 4. Theprocessing of the steps in FIG. 5 is executed by the system control unit104 controlling the various units of the communication apparatus 100.

At step S501, the system control unit 104 controls the host IF 114 totransmit the CMD 53(W). At step S502, the system control unit 104controls the host IF 114 to receive a response. Also, the system controlunit 104 controls the response processing unit 111 to determine that thecommand was transmitted normally regardless of the contents of theresponse, and advances the processing to step S503. At step S503, thesystem control unit 104 controls the host IF 114 to transmit a packetloaded with streaming data.

At step S504, the system control unit 104 controls the host IF 114 towait for an SDIO interrupt. The system control unit 104, upon detectingan SDIO interrupt from the slave IF 121, advances the processing to stepS505. At step S505, the system control unit 104 controls the host IF 114to issue the CMD 52(R). At step S506, the system control unit 104controls the host IF 114 to receive a response. At step S507, the systemcontrol unit 104 determines whether there is an error in the contents ofthe response. If there is an error, the processing advances to stepS508, and if there is not an error, the processing advances to stepS509.

At step S508, the system control unit 104 controls the SDCLK controlunit 107 to lower the SDCLK (clock frequency) to a frequency at whichpackets can be received. For example, the SDCLK is set to a clock in anon-UHS region.

At step S509, the system control unit 104 controls the host IF 114 toissue the CMD 53(R). At step S510, the system control unit 104 controlsthe host IF 114 to receive a response. At step S511, the host IF 114completes packet reception. At step S512, the system control unit 104controls the SDCLK control unit 107 to raise the clock frequency, in thecase where the clock frequency was lowered in step S508. Typically, thesystem control unit 104 raises the clock frequency to the originalfrequency, but any frequency that is higher than the frequencysubsequent to being lowered in step S508 may be set. Thereafter, theprocessing returns to step S501 and the system control unit 104 repeatssimilar processing.

According to the present embodiment, as described above, thecommunication apparatus 100 issues a read command in response to an SDIOinterrupt, and lowers the clock frequency of the host IF 114 to afrequency at which packets can be received if the response to this readcommand is an error. Tuning thereby no longer needs to be executedduring streaming, and a reduction in the data transfer rate duringstreaming can be suppressed.

Note that although description was given using the CMD 52 and the CMD 53in the present embodiment, the type of command is not limited and othercommands may be used.

Also, in the present embodiment, description was given assuming that theclock frequency is lowered to a frequency at which packets can bereceived in step S4011 of FIG. 4 and step S508 of FIG. 5, in the casewhere there is an error in the response in step S4010 of FIG. 4 and stepS507 of FIG. 5. However, in step S4011 of FIG. 4 and step S508 of FIG.5, tuning may be performed instead of lowering the clock frequency. Evenin this case, a reduction in the data transfer rate can be suppressed tosome extent, since tuning is not executed very frequently.

Third Embodiment

The first and second embodiments described the case where thecommunication apparatus 100 performs streaming transmission. Incontrast, the third embodiment describes the case where thecommunication apparatus 100 performs streaming reception. In the presentembodiment, the basic configuration of the communication apparatus 100is similar to the first embodiment (see FIGS. 1, 2A and 2B).Hereinafter, the differences from the first embodiment will mainly bedescribed.

FIG. 6 is a sequence diagram illustrating streaming transfer controlaccording to the third embodiment. In FIG. 6, processing that isexecuted by the host IF 114 is realized by the system control unit 104controlling the various units of the communication apparatus 100. Theprocessing of FIG. 6 is performed when the user operates the operationunit 105 to start reception of stream data. Note that the receivedstream data is recorded to the SD memory card 113.

At step S6001, the system control unit 104 controls the SDCLK controlunit 107 to set the clock frequency to a frequency (e.g., 50 MHz) thatis lower than the maximum frequency (predetermined frequency) prescribedin UHS-I. The SDCLK control unit 107 controls the clock source 251 tochange the frequency of the clock signal to the set frequency. Althoughit takes longer for the host IF 114 to receive data transmitted from theslave IF 121 if the clock frequency is low, the host IF 114 is able toreceive packets normally without tuning.

At step S6002, the slave IF 121 notifies a packet transmission event tothe host IF 114 with an SDIO interrupt. At step S6003, the systemcontrol unit 104 controls the host IF 114 to issue the CMD 52(R). Atstep S6004, the system control unit 104 receives a response. At stepS6005, the system control unit 104 controls the host IF 114 to issue theCMD 53(R). At step S6006, the system control unit 104 receives aresponse.

In the present embodiment, in the case of performing data transmissionfrom the slave IF 121, header information indicating the type and sizeof data and actual data such as moving image data are stored andtransmitted in separate packets. Thus, at step S6007, the slave IF 121starts packet transmission of header information. At step S6008, theslave IF 121 transmits a packet to the host IF 114. At step S6009, thehost IF 114 completes packet reception of header information.

At step S6010, the system control unit 104 analyzes the headerinformation and detects the size (data amount), stored in the headerinformation, of the packet to be transmitted next. The system controlunit 104 then determines whether the clock frequency needs to be raised,based on the detected size. If it is determined that the clock frequencyneeds to be raised, the processing advances to step S6011, and if thisis not the case, the processing advances to step S6013. Thedetermination method of step S6010 will be discussed in detail later.

If it is determined that the clock frequency needs to be raised, thesystem control unit 104, at step S6011, controls the SDCLK control unit107 to raise the clock frequency to a frequency (e.g., 100 MHz) in a UHSregion. The SDCLK control unit 107 controls the clock source 251 tochange the frequency of the clock signal to the set frequency. At stepS6012, the system control unit 104 controls the tuning unit 106 toimplement tuning.

At step S6013, the system control unit 104 controls the host IF 114 toissue the CMD 53(R). At step S6014, the host IF 114 receives a response.At step S6015, the slave IF 121 starts packet transmission. At stepS6016, the slave IF 121 transmits a packet to the host IF 114. If theclock frequency was raised in step S6011 and tuning was performed instep S6012, the host IF 114 is able to receive data (packets) at highspeed without error (or with few errors). At step S6017, the host IF 114completes packet reception.

Since packets need to be received continuously in streaming reception,after step S6017, the system control unit 104 returns the processing tostep S6002 and repeats the abovementioned controls. Also, because theclock frequency is already high in the case where the processing of stepS6010 is performed again after the processing of steps S6011 and S6012has been executed once, it is determined that the clock frequency doesnot need to be raised regardless of the header information received atstep S6008.

Next, the determination method of step S6010 will be described indetail. The present embodiment is not limited to a specificdetermination method, and, as one example, the system control unit 104determines that the clock frequency needs to be raised if the size (dataamount) of the packet to be transmitted next is greater than or equal toa threshold.

As another example of the determination method, the system control unit104 derives a time TRt required to receive data at the current clockfrequency, based on the detected data amount and the current clockfrequency. Furthermore, the system control unit 104 derives a time NTRtrequired to receive data in the case where the clock frequency isincreased, based on the detected data amount and the changed clockfrequency. The system control unit 104 then determines whether the clockfrequency needs to be raised, by determining whether the followingconditional expression 1 holds, based on a time Tt required to performtuning and TRt and NTRt derived as aforementioned:NTRt+Tt<TRt.  Conditional expression 1That is, the system control unit 104 determines that the clock frequencyneeds to be raised, in the case where the total time required to receivedata and perform tuning in the case where the frequency is raised isshorter than the time required to receive data in the case where thefrequency is not raised.

FIG. 7 is a flowchart of controls executed by the communicationapparatus 100 that correspond to the sequence diagram of FIG. 6. Theprocessing of the steps of FIG. 7 is executed by the system control unit104 controlling the various units of the communication apparatus 100.

At step S701, the system control unit 104 controls the SDCLK controlunit 107 to change the SDCLK to a frequency (e.g., 50 MHz) in a non-UHSregion. At step S702, the system control unit 104 controls the host IF114 to wait for an SDIO interrupt. The system control unit 104, upondetecting an SDIO interrupt from the slave IF 121, advances theprocessing to step S703. At step S703, the system control unit 104controls the host IF 114 to issue the CMD 52(R). At step S704, thesystem control unit 104 controls the host IF 114 to receive a response.At step S705, the system control unit 104 controls the host IF 114 toissue the CMD 53(R). At step S706, the system control unit 104 controlsthe host IF 114 to receive a response. At step S707, the system controlunit 104 controls the host IF 114 to receive a packet transmitted fromthe slave IF 121. This packet includes header information.

At step S708, the system control unit 104 determines whether the clockfrequency needs to be raised for the next packet reception, based on thesize (data amount), stored in the header information received at stepS707, of the packet to be transmitted next. If it is determined that theclock frequency needs to be raised, the processing advances to stepS709, and if this is not the case, the processing advances to step S711.

At step S709, the system control unit 104 controls the SDCLK controlunit 107 to raise the clock frequency to a frequency (e.g., 100 MHz) ina UHS region. At step S710, the system control unit 104 controls thetuning unit 106 to implement tuning.

At step S711, the system control unit 104 controls the host IF 114 toissue the CMD 53(R). At step S712, the system control unit 104 controlsthe host IF 114 to receive a response. At step S713, the system controlunit 104 controls the host IF 114 to receive a packet transmitted fromthe slave IF 121.

Thereafter, the system control unit 104 returns the processing to stepS702 and repeats the abovementioned controls. Also, because the clockfrequency is already high in the case where the processing of step S708is performed again after the processing of steps S709 and S710 has beenexecuted once, it is determined that the clock frequency does not needto be raised regardless of the header information received at step S707.

According to the third embodiment, as described above, the communicationapparatus 100 starts streaming reception using a clock of a non-UHSregion. The communication apparatus 100 determines the size of theactual data to be received based on the received header information, andcontinues streaming reception with the clock of a non-UHS region if thesize of the actual data is small. If the size of the actual data islarge, the communication apparatus 100 raises the clock frequency,performs tuning, and thereafter performs streaming reception with a highclock frequency. It is thereby possible to suppress the frequency withwhich tuning is performed, and to suppress a reduction in the datatransfer rate during streaming.

Other Embodiments

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-109427, filed May 27, 2014, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A communication apparatus having a CPU and a memory which stores instructions executable by the CPU, comprising: an output unit configured to output a clock signal to a communication module that communicates with an external device; a generation unit configured to generate a timing signal by delaying the clock signal; a communication unit configured to transmit data to the communication module according to the clock signal, and to receive data from the communication module in accordance with a timing corresponding to the timing signal; an adjustment unit configured to perform an adjustment process for requesting a predetermined test pattern from the communication module and for adjusting an amount of the delay in accordance with a result of receiving the test pattern which is sent from the communication module in response to the request of the test pattern and is received by the communication unit in accordance with the timing signal; and a control unit configured to control the communication unit, in a predetermined mode for continuously transmitting stream data to the communication module, to repeatedly perform first processing for transmitting a first command to the communication module, second processing for receiving a first response that is sent from the communication module in response to the first command, and third processing for transmitting a packet including the stream data to the communication module according to the first response, wherein, in the predetermined mode, if the first response sent from the communication module in response to the first command is received by the communication unit, the control unit controls the communication unit to perform processing for transmitting the packet including the stream data by the third process regardless of contents of the first response sent from the communication module in response to the first command and received by the communication unit, and if the first response sent from the communication module in response to the first command is not received by the communication unit, the control unit controls the communication unit so that the packet including the stream data is not transmitted to the communication module, wherein, in the predetermined mode, the control unit controls the communication unit to transmit a second command different from the first command to the communication module and controls the adjustment unit to perform the adjustment process if there is an error in a second response sent from the communication module in response to the second command, and wherein the control unit is implemented by the CPU.
 2. The apparatus according to claim 1, wherein the control unit performs control to not perform the adjustment process by the adjustment unit while the communication unit is repeatedly performing the first processing, the second processing, and the third processing.
 3. The apparatus according to claim 1, wherein the control unit controls the communication unit to transmit the second command according to an interrupt from the communication module that is received by the communication unit and to receive the second response transmitted by the communication module in response to the second command.
 4. The apparatus according to claim 1, wherein the communication module performs wireless communication with the external device.
 5. A method for controlling a communication apparatus having: an output unit configured to output a clock signal to a communication module that communicates with an external device; a generation unit configured to generate a timing signal by delaying the clock signal; and a communication unit configured to transmit data to the communication module according to the clock signal, and to receive data from the communication module in accordance with a timing corresponding to the timing signal, the method comprising: performing an adjustment process for requesting a predetermined test pattern from the communication module and for adjusting an amount of the delay in accordance with a result of receiving the test pattern which is sent from the communication module in response to the request of the test pattern and is received by the communication unit in accordance with the timing signal; and controlling the communication unit, in a predetermined mode for continuously transmitting stream data to the communication module, to repeatedly perform first processing for transmitting a first command to the communication module, second processing for receiving a first response that is sent from the communication module in response to the first command, and third processing for transmitting a packet including the stream data to the communication module according to the first response, wherein, in the predetermined mode, if the first response sent from the communication module in response to the first command is received by the communication unit, the communication unit is controlled to perform processing for transmitting the packet including the stream data by the third process regardless of contents of the first response sent from the communication module in response to the first command and received by the communication unit, and if the first response sent from the communication module in response to the first command is not received by the communication unit, the communication unit is controlled so that the packet including the stream data is not transmitted to the communication module, wherein, in the predetermined mode, the communication unit is controlled to transmit a second command different from the first command to the communication module and controls to perform the adjustment process if there is an error in a second response sent from the communication module in response to the second command, and wherein at least the controlling is performed by a CPU operating under control of instructions stored in a memory.
 6. The apparatus according to claim 1, further comprising: an input unit including an image capturing device, wherein the communication unit transmits the packet including moving image data obtained by the input unit to the communication module. 